<template>
  <el-form :model="form" label-width="120px">
    <el-form-item label="服务器地址">
      <el-input
        v-model="form.localServer"
        placeholder="http://127.0.0.1:39985"
      />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">确定</el-button>
    </el-form-item>
  </el-form>
</template>

<script lang="ts" setup>
import { reactive } from "vue";
import { localServer } from "@/api/utils";

// do not use same name with ref
const form = reactive({
  localServer: localServer("")
});

const onSubmit = () => {
  localStorage.setItem("localServer", form.localServer);
};
</script>
